(function(func){
    if( typeof(define) === undefined ){
        define('dynamicWrite',function(){
            return func(window) ;
        }) ;
    } else {
        window.dynamic = window.dynamic||{} ;
        window.dynamic.write = func(window) ;
    }
}(function(win){
    var style = document.createElement('style') ;
    var head = document.getElementsByTagName('head')[0] ;
    var writeScript = function(scriptStr){
        var script = document.createElement('script') ;
        script.type = 'text/javascript' ;
        script.innerHTML = scriptStr ;
        head.appendChild(script) ;
        head.removeChild(script) ;
    } ;
    var writeCss = function(css){
        if( style.styleSheet ){
            style.styleSheet.cssText = css ;
        } else {
            style.appendChild(document.createTextNode(css)) ;
        }
    } ;
    head.appendChild(style ) ;
    return {
        'js' : writeScript ,
        'css' : writeCss
    } ;
})) ;